#include<iostream>
#include<vector>
using namespace std;

class Solution {
public:
    vector<int> twoSum(vector<int>& price, int target) {
        // vector<int> ret;

        int left = 0, right = price.size() - 1;
        while (left < right) {
            int sum = price[left] + price[right];
            if (sum > target)
            {
                right--;
            } else if (sum < target)
            {
                left++;
            } else if (sum == target)
            {
                // ret.push_back(price[left]);
                // ret.push_back(price[right]);
                // break;
                return {price[left],price[right]}; // 初始化链表
            }
        }

        //return ret;
        return {-1,-1};
    }
};

int main()
{

	return 0;
}
